package com.CampusLife.controller;

import  com.CampusLife.bean.LostProductType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import  com.CampusLife.service.ILostProductTypeService;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/lostProductType")
public class LostProductTypeController {
    @Resource
    private ILostProductTypeService iLostProductTypeService;
    @RequestMapping("/queryAll")
    public  String  findall(Model model){
        List<LostProductType> lostProductTypes=iLostProductTypeService.queryAll();
        model.addAttribute("lostProductTypes",lostProductTypes);
        return "admin/lostTypebasic";
    }
    @RequestMapping("/add")
    public String add(LostProductType lostProductType){
        iLostProductTypeService.add(lostProductType);
        return "";
    }
   @RequestMapping("/byid")
   public String Byid(Integer l_tid){
        iLostProductTypeService.queryById(l_tid);
        return "";
   }

    @RequestMapping("/delete")
    public  String delete(Integer l_tid,Model model){
        iLostProductTypeService.delete(l_tid);
        return "";
    }
}
